package Demo17;

public class Demo {

//    public static void main(String[] args) {
//        Thread t = new Thread(()->{
//            System.out.println(Thread.currentThread());
//            //Thread.currentThread().interrupt();
//            while (!Thread.currentThread().isInterrupted()) {
//                System.out.println("haha");
//                System.out.println(Thread.currentThread().isInterrupted());
//            }
//
//        });
//        t.start();
//        t.interrupt();
//        System.out.println(Thread.currentThread());
//    }

    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread(()->{
            System.out.println("haha");
        });
        Thread t2 = new Thread(()->{
            System.out.println("hehe");
        });

        t1.start();
        t2.start();
//        t1.join();
//        t2.join();
        System.out.println("heihei");

    }
}
